﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace SMG.Domain.Specifications
{
    public interface ICompositeSpecification<T> : ISpecification<T>
    {
        /// <summary>
        /// Gets the left side of the specification.
        /// </summary>
        ISpecification<T> Left { get; }
        /// <summary>
        /// Gets the right side of the specification.
        /// </summary>
        ISpecification<T> Right { get; }
    }

    public abstract class CompositeSpecification<T> : Specification<T>, ICompositeSpecification<T>
    {
        private ISpecification<T> _left;
        private ISpecification<T> _right;

        public CompositeSpecification(ISpecification<T> left, ISpecification<T> right) {
            this._left = left;
            this._right = right;
        }

        #region ICompositeSpecification Members

        public ISpecification<T> Left
        {
            get { return _left; }
        }

        public ISpecification<T> Right
        {
            get { return _right; }
        }

        #endregion

    }
}
